package com.tuanzi.loan.web.lazy.family;

import com.tuanzi.loan.business.service.family.ProductInfoService;
import com.tuanzi.loan.core.vo.PageSearcher;
import com.tuanzi.loan.vo.request.family.ProductInfoSearchRequest;
import com.tuanzi.loan.vo.response.family.ProductInfoSearchResponse;
import com.tuanzi.loan.web.bean.CurrentUserBean;
import com.tuanzi.loan.web.lazy.LazyDataSessionModel;
import org.springframework.data.domain.Page;

/**
 * @author Ray 2017/09/21
 */
public class ProductInfoLazyDataModel extends LazyDataSessionModel<ProductInfoSearchRequest, ProductInfoSearchResponse> {

    private static final long serialVersionUID = 9143007553234885156L;

    private ProductInfoService productInfoService;

    public ProductInfoLazyDataModel(ProductInfoSearchRequest searchRequest, CurrentUserBean session, ProductInfoService productInfoService) {
        super(searchRequest, session);
        this.productInfoService = productInfoService;
    }

    @Override
    protected Page<ProductInfoSearchResponse> doLoad0(PageSearcher<ProductInfoSearchRequest> pageSearcher) {
        return productInfoService.list(pageSearcher);
    }
}
